import { axios } from '@/utils/request'

const api = {
  banner: '/validate/rule-bi/banner',
  scoreTrend: '/validate/rule-bi/scoreTrend',
  scoreRank: '/validate/rule-bi/scoreRank',
  scoreDetailGroupByRuleType: '/validate/rule-bi/scoreDetailGroupByRuleType',
  scoreDetail: '/validate/rule-bi/scoreDetail',
  queryErrorData: '/validate/rule-bi/queryErrorData',
  querySummary: '/validate/rule-score/querySummary'
}

export function banner (params) {
  return axios({
    url: api.banner,
    params: params,
    method: 'get'
  })
}

export function scoreTrend () {
  return axios({
    url: api.scoreTrend,
    method: 'get'
  })
}

export function scoreRank () {
  return axios({
    url: api.scoreRank,
    method: 'get'
  })
}

export function scoreDetailGroupByRuleType (params) {
  return axios({
    url: api.scoreDetailGroupByRuleType,
    method: 'get',
    params: params
  })
}

export function scoreDetail (params) {
  return axios({
    url: api.scoreDetail,
    method: 'get',
    params: params
  })
}

export function queryErrorData (params) {
  return axios({
    url: api.queryErrorData,
    method: 'get',
    params: params
  })
}

export function querySummary (params, pageNum, pageSize) {
  if (!params) {
    params = {}
  }
  params.pageNum = pageNum
  params.pageSize = pageSize
  return axios({
    url: api.querySummary,
    params: params,
    method: 'get'
  })
}
